package com.sk.cardeal.dialog;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.sk.cardeal.R;
import com.sk.cardeal.base.BaseDialogFragment;
import com.sk.cardeal.callback.MyCallBack;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by sk on 2018/3/14.
 */

public class CountDialogFragment extends BaseDialogFragment {

    @BindView(R.id.today)
    TextView today;
    @BindView(R.id.t_week)
    TextView tWeek;
    @BindView(R.id.t_month)
    TextView tMonth;

    private MyCallBack myCallBack;

    public MyCallBack getMyCallBack() {
        return myCallBack;
    }

    public void setMyCallBack(MyCallBack myCallBack) {
        this.myCallBack = myCallBack;
    }

    @Override
    protected int getContentView() {
        return R.layout.dialog_count;
    }

    @OnClick({R.id.today, R.id.t_week, R.id.t_month})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.today:
                dismiss();
                if(myCallBack!=null){
                    myCallBack.clickView(R.id.today);
                }
                break;
            case R.id.t_week:
                dismiss();
                if(myCallBack!=null){
                    myCallBack.clickView(R.id.t_week);
                }
                break;
            case R.id.t_month:
                dismiss();
                if(myCallBack!=null){
                    myCallBack.clickView(R.id.t_month);
                }
                break;
        }
    }
}
